<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 组合选择器 */
        table,th,td{
            border: 1px solid rgb(230, 62, 62);
        }
        table{
            /* 边框线的合并 */
            border-collapse: collapse;
            width: 400px;
            text-align: center;
        }
        /* 光标悬停变色 */
        tbody tr:hover{
            background-color: cornflowerblue;
        }
        /* 隔行换色 */
        tbody tr:nth-child(odd){
            /* odd=2n+1  奇数 */
            /* even=2n  偶数 */
            background-color: rgb(172, 169, 166);
        }
    </style>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>性别</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1001</td>
                <td>张三</td>
                <td>男</td>
            </tr>
            <tr>
                <td>1002</td>
                <td>张四</td>
                <td>女</td>
            </tr>
            <tr>
                <td>1001</td>
                <td>张三</td>
                <td>男</td>
            </tr>
            <tr>
                <td>1002</td>
                <td>张四</td>
                <td>女</td>
            </tr>
            <tr>
                <td>1001</td>
                <td>张三</td>
                <td>男</td>
            </tr>
            <tr>
                <td>1002</td>
                <td>张四</td>
                <td>女</td>
            </tr>
            <tr>
                <td>1001</td>
                <td>张三</td>
                <td>男</td>
            </tr>
            <tr>
                <td>1002</td>
                <td>张四</td>
                <td>女</td>
            </tr>
        </tbody>
    </table>
</body>
</html>